﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MakeItWeb.Framework;

namespace AllNations.UI.Controls
{
    public partial class BlogConfiguration : System.Web.UI.UserControl, IDynamicPageConfiguration
    {
        Framework.BloggerConfiguration _Config = new Framework.BloggerConfiguration();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        string IDynamicPageConfiguration.ConfigurationSectionLabel
        {
            get { return "Blogger page size:"; }
        }

        void IDynamicPageConfiguration.LoadSettings(string sSettings)
        {
            _Config.Deserialize(sSettings);

            txtBlogPageSize.Text = _Config.PageSize.ToString();
        }

        string IDynamicPageConfiguration.SaveSettings()
        {
            _Config.PageSize = int.Parse(txtBlogPageSize.Text.Trim());
            return _Config.Serialize();
        }
    }
}